<%-- 
    Document   : menuadd
    Created on : 2014-3-8, 17:20:38
    Author     : lcfgly
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page trimDirectiveWhitespaces="true" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="sf" %>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">

        <title>栏目添加</title>

        <meta name="description" content="栏目添加">
        <meta name="author" content="pixelcave">
        <meta name="robots" content="noindex, nofollow">

        <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1.0">
        <%@include file="/WEB-INF/jspf/css.jspf" %>
    </head>
    <body>
        <div id="page-container" class="full-width">
            <header class="navbar navbar-inverse">
                <%@include file="/WEB-INF/jspf/header.jspf" %>
            </header>
            <jsp:include page="/control/left.html" flush="true" />
            <!-- END Left Sidebar -->
            <!-- Pre Page Content -->
            <div id="pre-page-content" style="min-height: 20px">
                <h1><i class="glyphicon-tags themed-color" style="line-height: 40px"></i> 栏目添加</h1>
            </div>
            <!-- END Pre Page Content -->

            <!-- Page Content -->
            <div id="page-content">
                <!-- Breadcrumb -->
                <!-- You can have the breadcrumb stick on scrolling just by adding the following attributes with their values (data-spy="affix" data-offset-top="250") -->
                <!-- You can try it on other elements too :-), the sticky position and style can be adjusted in the css/main.css with .affix class -->
                <ul class="breadcrumb" data-spy="affix" data-offset-top="250">
                    <li>
                        <a href="<c:url value="/control/index.html" />"><i class="glyphicon-display"></i></a> <span class="divider"><i class="icon-angle-right"></i></span>
                    </li>
                    <li>
                        <a href="<c:url value="/control/menu.html" />">栏目管理</a> <span class="divider"><i class="icon-angle-right"></i></span>
                    </li>
                    <li class="active"><a href="#">栏目添加</a></li>
                </ul>
                <!-- END Breadcrumb -->

                <!-- Color Pickers Block --><!-- END Color Pickers Block -->

                <!-- Time and Date Pickers Block -->
                <div class="block block-themed">
                    <!-- Time and Date Pickers Title -->
                    <div class="block-title">
                        <h4><i class="icon-gears"></i> 栏目编辑</h4>
                    </div>
                    <!-- END Time and Date Pickers Title -->

                    <!-- Time and Date Pickers Content -->
                    <div class="block-content">
                        <form id="menupostform" method="post" class="form-horizontal" >
                            <div class="control-group">
                                <label class="control-label" for="input-timepicker">栏目名称</label>
                                <div class="controls">
                                    <div class="input-append">
                                        <input type="text" name="typename" class="span5" placeholder="栏目名称">
                                    </div>
                                    <span class="help-block" style="color: red;">${error.typename}</span>
                                </div>
                            </div>
                            <div class="control-group">
                                <label class="control-label" for="input-timepicker">栏目类型</label>
                                <div class="controls">
                                    <div class="input-append">
                                        <select size="1" name="isnews" id="general-select">
                                            <option value="0">单页文档</option>
                                            <option value="1">新闻内容</option>
                                        </select>
                                    </div>
                                    <span class="help-block" style="color: red;">${error.type}</span>
                                </div>
                            </div>
                            <div class="control-group">
                                <label class="control-label" for="input-timepicker">栏目排序</label>
                                <div class="controls">
                                    <input type="text" data-placement="right" value="20" data-toggle="tooltip" name="sort" id="validation" data-original-title="填写1-65535之间的整数。数值越大栏目排序越靠前">
                                    <span class="help-block error-color" style="color: red;">${error.sort}</span>
                                </div>
                            </div>
                            <div class="form-actions">
                                <button type="reset" class="btn btn-danger"><i class="icon-repeat"></i> 清空</button>
                                <button type="submit" class="btn btn-success"><i class="icon-ok"></i> 提交</button>
                            </div>
                        </form>
                    </div>
                    <!-- END Time and Date Pickers Content -->
                </div></div>
            <!-- END Page Content -->

            <!-- Footer -->
            <%@include file="/WEB-INF/jspf/footer.jspf" %>
            <!-- END Footer -->
        </div>
        <!-- END Page Container -->

        <a href="#" id="to-top"><i class="icon-chevron-up"></i></a>
        <%@include file="/WEB-INF/jspf/js.jspf" %>
        <script>
            $(function() {
                $('#menupostform').validate({
                    errorClass: "help-block",
                    errorElement: "span",
                    errorPlacement: function(error, element) {
                        element.parents(".controls").append(error);
                    },
                    highlight: function(e) {
                        $(e).closest(".control-group").removeClass("success error").addClass("error");
                    },
                    success: function(e) {
                        e.addClass("valid").closest(".control-group").removeClass("success error").addClass("success");
                    },
                    rules: {
                        typename: {
                            required: true
                        },
                        sort: {
                            range: [1, 65535]
                        }
                    },
                    messages: {
                        typename: "栏目名称不能为空",
                        sort: "请输入1到65535之间的整数"
                    }
                });
            });
        </script>
    </body>
</html>